package JMU1.ti301;

import java.util.Scanner;

/**
 * @author Lenovo
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String input= scanner.nextLine();
            int a =Integer.parseInt(input);
            if(a>=10000&&a<=20000){
                System.out.println(Integer.toBinaryString(a)+","+Integer.toOctalString(a)+","+Integer.toHexString(a));
            }
            else {
                int num=0;
                for (int i=0;i<input.length();i++){
                    char c=input.charAt(i);
                    if(Character.isDigit(c)){
                        num+=c-'0';
                        System.out.printf("%c ",c);
                    }
                }
                System.out.println(num);
            }
        }
    }
}
